package com.hzqy.persistence.dao.hotel;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.CmAdvertiseStrategyVo;
import com.hzqy.web.vo.CmAdvertiseVo;
import com.hzqy.web.vo.HotelUserNeedsVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class HotelAdvertiseDao extends PersistenceDao<CmAdvertiseVo, Integer>{
	protected final Logger LOG = LoggerFactory.getLogger(getClass());

	public int selectHotelAdvertiseCount(CmAdvertiseVo cmAdvertiseVo) {
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "selectHotelAdvertiseCount", cmAdvertiseVo);
	}

	public List<CmAdvertiseVo> selectHotelAdvertiseList(Map<String,Object> map){
		String namespace = this.getNamespace();
		return getSqlSession().selectList(namespace + "selectHotelAdvertiseList", map);
	}

	public CmAdvertiseVo selectAdvertiseById(int f_ca_id){
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "selectAdvertiseById", f_ca_id);
	}

	public List<CmAdvertiseVo> selectAdvertiseByOrderNumber(String f_ca_order_number){
		String namespace = this.getNamespace();
		return getSqlSession().selectList(namespace + "selectAdvertiseByOrderNumber", f_ca_order_number);
	}

	public List<CmAdvertiseVo> selectAdvertiseByStatus(){
		String namespace = this.getNamespace();
		return getSqlSession().selectList(namespace + "selectAdvertiseByStatus");
	}

	public int deleteAdvertise(CmAdvertiseVo cmAdvertiseVo){
		String namespace = this.getNamespace();
		return getSqlSession().update(namespace + "deleteAdvertise", cmAdvertiseVo);
	}

	public int insertAdvertise(CmAdvertiseVo cmAdvertiseVo){
		String namespace = this.getNamespace();
		return getSqlSession().insert(namespace + "insertAdvertise", cmAdvertiseVo);
	}

	public int updateAdvertise(CmAdvertiseVo cmAdvertiseVo){
		String namespace = this.getNamespace();
		return getSqlSession().update(namespace + "updateAdvertise", cmAdvertiseVo);
	}

	public int selectAdvertiseStrategyCount(CmAdvertiseStrategyVo cmAdvertiseStrategyVo) {
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "selectAdvertiseStrategyCount", cmAdvertiseStrategyVo);
	}

	public List<CmAdvertiseStrategyVo> selectAdvertiseStrategyList(Map<String,Object> map){
		String namespace = this.getNamespace();
		return getSqlSession().selectList(namespace + "selectAdvertiseStrategyList", map);
	}

	public CmAdvertiseStrategyVo selectAdvertiseStrategyById(int f_cas_id){
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "selectAdvertiseStrategyById", f_cas_id);
	}

	public int deleteAdvertiseStrategy(int f_cas_id){
		String namespace = this.getNamespace();
		return getSqlSession().update(namespace + "deleteAdvertiseStrategy", f_cas_id);
	}

	public int insertAdvertiseStrategy(CmAdvertiseStrategyVo cmAdvertiseStrategyVo){
		String namespace = this.getNamespace();
		return getSqlSession().insert(namespace + "insertAdvertiseStrategy", cmAdvertiseStrategyVo);
	}

	public int updateAdvertiseStrategy(CmAdvertiseStrategyVo cmAdvertiseStrategyVo){
		String namespace = this.getNamespace();
		return getSqlSession().insert(namespace + "updateAdvertiseStrategy", cmAdvertiseStrategyVo);
	}

	public int updateAdvertiseStrategyStatus(CmAdvertiseStrategyVo cmAdvertiseStrategyVo){
		String namespace = this.getNamespace();
		return getSqlSession().insert(namespace + "updateAdvertiseStrategyStatus", cmAdvertiseStrategyVo);
	}
}
